View Javadoc

1   /*
2    * Copyright (c) 2004-2005, University Health Network.  All rights reserved. Distributed under the BSD 
3    * license (see http://opensource.org/licenses/bsd-license.php).
4    *  
5    * Created on 20-Dec-2004
6    */
7   package ca.uhn.cache.internal;
8   
9   import ca.uhn.cache.IDimension;
10  import ca.uhn.cache.IQueryParam;
11  
12  /***
13   * Configuration data for a <code>ParamSpace</code>.
14   *   
15   * @author <a href="mailto:bryan.tripp@uhn.on.ca">Bryan Tripp</a>
16   * @version $Revision: 1.1 $ updated on $Date: 2005/01/24 22:53:27 $ by $Author: bryan_tripp $
17   */
18  public interface IParamSpaceConfig {
19  
20      /***
21       * @return a list of dimensions according to which data are organized. 
22       */  
23      public IDimension[] getDimensions();
24          
25      /***
26       * This method is only meaningful along dimensions for which isChunked() 
27       * returns true.
28       *   
29       * @param theDimension a dimension in the space (must be one of those 
30       *      returned by getDimensions()).  
31       * @return the limits of each chunk along the given dimension.  The 
32       *      whole space must be covered by this list.  Returns an empty array 
33       *      if isChunked() returns false for the given dimension.  
34       */
35      public IQueryParam[] getChunkBoundaries(IDimension theDimension);
36      
37      /***
38       * True iff data are split into a known list of chunks along this dimension  
39       * (the usual case).  If true, then getChunkBoundaries() must return a list 
40       * of the boundaries of chunks along this dimension.  
41       * 
42       * Dimensions are not always chunked.  For example a dimension may correspond 
43       * to a large, volatile list of values such as person IDs.  It would not be 
44       * efficient to provide a complete list of (possibly millions of) chunk 
45       * boundaries for such dimensions, or to iterate through them to see which 
46       * ones are intersected by a query.  For such dimensions it is assumed that 
47       * any valid IQueryParam corresponds to a chunk.  For example in an employee ID 
48       * dimension, it might make sense to have each chunk encompass exactly one 
49       * ID, in which case this method would return false.    
50       * 
51       * @param theDimension one of the values returned by getDimensions().
52       * @return true iff data are split into a known list of chunks along this 
53       *      dimension 
54       */
55      public boolean isChunked(IDimension theDimension);
56      
57      /***
58       * For ordered dimensions, the distances between their members is important.  
59       * Distances (see IQueryParam.getDistance()) are normalized to between zero 
60       * and 1.  The distance corresponding to 1 is configurable.  For example 
61       * a time dimension may have a relevant range over the last week or the last 
62       * 20 years.  In the first case, a difference of a week would correspond to 
63       * a distance of 1, and in the second case a difference of 20 years would 
64       * correspond to 1.  
65       * 
66       * @param theDimension a dimension in this space
67       * @return the param corresponding to a distance of 1, from the origin that 
68       *      is natural for that dimension (e.g. now for a time dimension, 'a' for 
69       *      an alphabetical dimension).  Null for non-ordered dimensions.  
70       */
71      public IQueryParam getSaturationPoint(IDimension theDimension);
72      
73  }